//
//  BaseNavController.m
//  PlayCatchGame
//
//  Created by 流言 on 2018/1/15.
//  Copyright © 2018年 清正. All rights reserved.
//

#import "BaseNavController.h"
#import "AppHeader.h"

@interface BaseNavController ()

@end

@implementation BaseNavController

- (void)viewDidLoad {
    [super viewDidLoad];
//    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc]init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
//    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc]init]];
    
    
    [self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:[[UIImage alloc] init]];

    if (@available(iOS 11.0, *)) {
        [UINavigationBar appearance].backIndicatorImage = [UIImage imageNamed:@"nav_back_11"];
        [UINavigationBar appearance].backIndicatorTransitionMaskImage = [UIImage imageNamed:@"nav_back_11"];
    } else {
        [UINavigationBar appearance].backIndicatorImage = [UIImage imageNamed:@"nav_back"];
        [UINavigationBar appearance].backIndicatorTransitionMaskImage = [UIImage imageNamed:@"nav_back"];
    }

    // 设置标题的字体和颜色
    UIColor *color = [UIColor whiteColor];
    NSDictionary *textAttributesDic = @{NSForegroundColorAttributeName:color, NSFontAttributeName:[UIFont boldSystemFontOfSize:19]};
    self.navigationBar.titleTextAttributes = textAttributesDic;

    // 设置导航栏按钮颜色
    [[UINavigationBar appearance] setTintColor:color];
    // 导航背景颜色
    [UINavigationBar appearance].barTintColor = APP_DEFAULT_COLOUR;
    [UINavigationBar appearance].translucent =NO;

    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    //调整返回按钮的文字位置，让文字不可见
//    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -64) forBarMetrics:UIBarMetricsDefault];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
